<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport"
        content="width=device-width, initial-scale=1, maximum-scale=1.0,minimum-scale=1.0,user-scalable=no"/>
  <meta name="format-detection" content="telephone=no, email=no"/>
  <!-- 忽略页面中的数字识别为电话，忽略email识别 -->
  <meta name="applicable-device" content="mobile"/>
  <meta name="apple-mobile-web-app-title" content="标题"/>
  <!-- 添加到主屏后的标题（iOS 6 新增） -->
  <meta name="apple-mobile-web-app-capable" content="yes"/>
  <!-- 是否启用 WebApp 全屏模式 -->
  <meta name="HandheldFriendly" content="true"/>
  <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
  <meta name="keywords" content="直播盐都"/>
  <meta name="description" content="直播盐都"/>
  <meta name="cl">
  <title>${(proBack.name)!}</title>
  <link rel="stylesheet" type="text/css" href="${ctx}/sctv/h5/css/globle.css">
  <script src="${ctx}/sctv/h5/js/jquery-1.8.3.min.js" type="text/javascript"></script>
  <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
  <script type="text/javascript" src="http://qzonestyle.gtimg.cn/qzone/qzact/common/share/share.js"></script>
  <!--<script type="text/javascript" src="${ctx}/sctv/h5/js/senShare.js"></script>-->
</head>
<body style="background: #eee;">
<!--video s-->
<div class="ground_video">
  [#list programBackcodes as proBackCode]
  <p id="thisTit">${(proBackCode.name)!}</p>
  <video id="video" class="videoBox" src="${(proBackCode.video)!}" controls poster=''></video>
  <!--<i class="iconFont" onclick="videoPlay('video')"></i>-->
  [#break]
  [/#list]
</div>
<!--video e-->
<!--cont s-->
<div class="ground_box">
  <h1>${(proBack.name)!}</h1>
  <ul>
    [#list programBackcodes as proBackCode]
    <li>
      <a class="box" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.sctv.scfocus">
        <div class="ground_tit flex">
          <h2>${(proBackCode.name)!}</h2>
          <p><span>${(proBackCode.time?string('MM-dd'))!}</span>[#if proBackCode.playNumStr!='0']<span class="fr">播放${(proBackCode.playNumStr)!}次</span>[/#if]</p>
        </div>
        <div class="ground_img"><img src="${(proBackCode.smallImage)!}" alt=""></div>
      </a>
    </li>
    [/#list]
  </ul>
</div>
<!--cont e-->

<!--底部 s-->
<div class="pdDownLoad">
  <img class="pdlogo1 fl" src="${ctx}/sctv/h5/images/down_word.png" alt="">
  <a  class="pdlogo2 fl" href="http://a.app.qq.com/o/simple.jsp?pkgname=com.sctv.scfocus"> <img src="${ctx}/sctv/h5/images/down.png" alt=""> </a>
  <img onclick="colseTan()" class="pdlogo3 fl" src="${ctx}/sctv/h5/images/close.png" alt="">
</div>
<!--底部 e-->

<script src="${ctx}/sctv/h5/js/main.js" type="text/javascript"></script>
<script>
  var thisTitle ="";
  $(function () {

    //getVideo();
    //视频比例
    ban_s(".ground_video");

    /*获取视频标题及地址图片*/
    //var linkInfo = window.location.href.split('?')[1];
    //var arrInfo = linkInfo.split('&');
   /* var videoUrl = arrInfo[0].split('=')[1];
    var videoTit = arrInfo[1].split('=')[1];
    var videoTit = arrInfo[2].split('=')[1];*/
   var videoUrl=getQueryString("programmeUrl");
   var videoTitle=getQueryString("programmeTitle");
   var programmeImage=getQueryString("programmeImage");

    $("#video").attr({'src':videoUrl});
    $("#video").attr({'poster':programmeImage});
    $("#thisTit").html(decodeURI(videoTitle));


    getInfo();
    thisTitle = decodeURI(videoTitle);

  })
  //获取url参数
  function getQueryString(key) {
    var url = window.location.search;
    // 正则筛选地址栏
    var reg = new RegExp("(^|&)"+ key +"=([^&]*)(&|$)");
    // 匹配目标参数
    var result = url.substr(1).match(reg);
    //返回参数值
    return result ? decodeURIComponent(result[2]) : null;

  }




  function getInfo(){
    var thisUrl = window.location.href;
    var thisId= '',thisTimeStamp = '',thisNonceStr = '',thisSignature ='';
    $.ajax({
      type: "post",
      /*url: "http://192.168.20.183:8080/getWxtoken",*/
      /*url: "http://scgcapi.sctv.com:28081/getWxtoken",*/
      url: "http://scgcapi.sctv.com:28080/scgc/getWxtoken",
      dataType : 'json',
      data:{'thisUrl':thisUrl},
      success: function (msg) {
        thisId = msg.appid;
        thisTimeStamp = msg.timestamp;
        thisNonceStr = msg.noncestr;
        thisSignature = msg.signature;
        getConfig(thisId,thisTimeStamp,thisNonceStr,thisSignature);
        getConfig2(thisId,thisTimeStamp,thisNonceStr,thisSignature);
      },
      error: function (msg) {
        // window.location.href = "404.jsp";
      }
    });

  }
  function getConfig2(id,stamp,Str,ture){
    setShareInfo({
      title: thisTitle,
      summary:"直播盐都·视频新闻第一屏",
      pic:'http://192.168.81.70:8080/logo/pingchang_logo.png',
      url: window.location.href,
      WXconfig:{
        swapTitleInWX: false,
        appId: id,
        timestamp: stamp,
        nonceStr: Str,
        signature:ture
      }
    });
  }


  /*初始化配置*/
  function getConfig(id,stamp,Str,ture){
    wx.config({
      debug: false,
      appId: id,
      timestamp: stamp,
      nonceStr: Str,
      signature: ture,
      jsApiList: [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareQZone'
      ]
    });
  }

  wx.ready(function () {
    // 1 判断当前版本是否支持指定 JS 接口，支持批量判断
    wx.checkJsApi({
      jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareQZone'], // 需要检测的JS接口列表，所有JS接口列表见附录2,
      success: function(res) {

      }
    });
    /*分享到朋友圈*/
    wx.onMenuShareTimeline({
      title:thisTitle, // 分享标题
      link: window.location.href, // 分享链接
      imgUrl: 'http://192.168.81.70:8080/logo/pingchang_logo.png', // 分享图标
      trigger: function (res) {

      },
      success: function () {

      },
      cancel: function () {

      }
    });
    /*分享到朋友*/

    wx.onMenuShareAppMessage({
      title: thisTitle, // 分享标题
      desc: "直播盐都·视频新闻第一屏", // 分享描述
      link: window.location.href, // 分享链接
      imgUrl: 'http://192.168.81.70:8080/logo/pingchang_logo.png', // 分享图标
      type: '', // 分享类型,music、video或link，不填默认为link
      dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
      success: function () {

      },
      cancel: function () {

      }
    });
    /*分享到QQ空间*/
    wx.onMenuShareQZone({
      title:thisTitle,  // 分享标题
      desc: "直播盐都·视频新闻第一屏", // 分享描述
      link: window.location.href, // 分享链接
      imgUrl: 'http://192.168.81.70:8080/logo/pingchang_logo.png', // 分享图标
      success: function () {
        // 用户确认分享后执行的回调函数
      },
      cancel: function () {
        // 用户取消分享后执行的回调函数
      }
    });
    /*分享到QQ*/
    wx.onMenuShareQQ({
      title: thisTitle, // 分享标题
      desc: "直播盐都·视频新闻第一屏", // 分享描述
      link: window.location.href, // 分享链接
      imgUrl: 'http://192.168.81.70:8080/logo/pingchang_logo.png', // 分享图标
      success: function () {
        // 用户确认分享后执行的回调函数
      },
      cancel: function () {
        // 用户取消分享后执行的回调函数
      }
    });
  });



</script>
</body>
</html>
